package cn.itsource.user.controller;

import cn.itsource.basic.util.AxajResult;
import cn.itsource.user.domain.dto.UserDto;
import cn.itsource.user.service.ILoginInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
//用户登录controller
@RestController
public class LoginInfoContoller {
    @Autowired
    private ILoginInfoService loginInfoService;
    @RequestMapping("/login")
    public AxajResult login(@RequestBody UserDto userDto){
        try {
            return loginInfoService.login(userDto);
        } catch (Exception e) {
            e.printStackTrace();
            return  new AxajResult(false,e.getMessage());
        }
    }
}
